﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ex03.GarageLogic
{
    /// <summary>
    /// elctric vehicle own this class as its energy source
    /// </summary>
    internal class ElectricityPowered : EnergySource
    {        
        public ElectricityPowered(float i_MaxFuelLiters)
            : base(i_MaxFuelLiters)
        {            
        }

        /// <summary>
        /// charge the energy source by using EnergySource.FillEnergy and convert the minuts time to hours
        /// </summary>
        /// <param name="i_NumberOfMinutesToCharge">num of minuts to charge</param>
        public void ChargeBattery(float i_NumberOfMinutesToCharge)
        {
            const float k_MinutesInHour = 60;
            FillEnergy(i_NumberOfMinutesToCharge / k_MinutesInHour);
        }

        /// <summary>
        /// Overriding <see cref="Object.ToString"/>
        /// </summary>
        /// <returns>string with Max Battery Hours, Battery Hours Left</returns>
        public override string ToString()
        {
            string toString = string.Empty;
            toString = string.Format(@"
Max Battery Hours: {0}
Battery Hours Left: {1}
"
                ,r_MaxEnergy
                , m_CurrentEnergy);

            return toString;
        }
    }
}
